package org.huangrui.juc.source.locks;

/**
 * 从字节码角度分析synchronized实现
 * @Author hr
 * @Create 2024-04-02 00:39
 */
public class T02_LockSync {
    Object object = new Object();
    public void m1(){
        synchronized (object)
        {
            System.out.println("----hello synchronized code block");
            // throw new RuntimeException("-----exp");
        }
    }
    public synchronized void m2()
    {
        System.out.println("----hello synchronized m2");
    }
    public static synchronized void m3()
    {
        System.out.println("----hello static synchronized m3");
    }

    public static void main(String[] args) {

    }
}
